﻿using System.ComponentModel.DataAnnotations;
using YFurion.Application;

namespace UpperComputer.Application
{
    public class BaseMenuButtonDto : EntityDto
    {
        [Required(ErrorMessage = "按钮编码不能为空"), RegularExpression(@"^[A-Z][a-zA-Z]{1,49}$", ErrorMessage = "按钮编码格式不正确")]
        public string Code { get; set; }

        [Required(ErrorMessage = "按钮名称不能为空"), StringLength(50, ErrorMessage = "按钮名称不能超过50个字符")]
        public string DisplayName { get; set; }

        [Required(ErrorMessage = "菜单编码不能为空"), RegularExpression(@"^[A-Z][a-zA-Z]{1,49}$", ErrorMessage = "菜单编码格式不正确")]
        public string MenuCode { get; set; }

        [Range(1, byte.MaxValue, ErrorMessage = "序号必须在1-255之间")]
        public int Sort { get; set; } = 1;

        [StringLength(100, ErrorMessage = "图标不能超过100个字符")]
        public string Icon { get; set; }

        public bool IsSplit { get; set; }

        public bool IsActive { get; set; }

        [StringLength(255, ErrorMessage = "描述不能超过255个字符")]
        public string Description { get; set; }
    }
}
